<template>
	<view class="userHelp">
		<view class="bannar">
			<image src="https://erised-fresh.oss-cn-shenzhen.aliyuncs.com/592800/4htUkoMA8bCSaf7cc8e49d08fbbcdf1131aba34db817.png" mode=""></image>
			</view>
		<view class="main">
			<view class="main_item" v-for="(item, index) in list" :key="index">
				<view v-if="item.children">
					<view class="title">{{ item.dictValue }}</view>
					<view>
						<view class="subMain" v-for="(e, j) in item.children" :key="j" @click="toUserDetail(e)">
							<view>{{ e.dictValue }}</view>
							<view><uni-icons type="arrowright" size="16" color="#999"></uni-icons></view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { getSystemTree } from '@/apis/personalCenter.js';
export default {
	onLoad() {
		uni.showLoading({
			title:'加载中',
			icon:'none'
		});
		getSystemTree({ code: 'use_help' }).then(res => {
			if (res) {
				this.list = res.data;
				uni.hideLoading();
			}
		});
	},
	data() {
		return {
			list: []
		};
	},
	methods:{
		toUserDetail(item) { 
			uni.navigateTo({
				url:'/pages/index/components/indexWebView?url=' + item.children[0].dictValue
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.userHelp {
	min-height: 100vh;
	background-color: #f3f6f8;
	.bannar {
		width: 750rpx;
		height: 280rpx;
		background-color: #0091ff;
		image {
			width: 100%;
			height: 100%;
		}
	}
	.main {
		// margin-top: 16rpx;
		padding: 0rpx 20rpx;
		// background-color: pink;
		padding-bottom: 100rpx;
		.title {
			margin-top: 32rpx;
			margin-bottom: 16rpx;
			font-size: 26rpx;
			color: #666;
		}
		.subMain {
			display: flex;
			justify-content: space-between;
			padding: 20rpx 28rpx;
			background: #ffffff;
			border-radius: 8rpx;
			font-size: 28rpx;
			color: #333;
			margin-bottom: 16rpx;
		}
	}
}
</style>
